#include <stdio.h>

int any(char s1[], char s2[]) { 		      	
  int i, j;
  int ret = -1;
  for(j=0; s2[j] != '\0'; j++)
    for(i=0; s1[i] != '\0'; i++)
      if(s1[i] == s2[j])
        if(ret<0)
          ret = i;
        else if(i<ret)
          ret = i;
  return ret;
} 		      	

int main()
{ 		      	

    char a[80], b[80];

    printf("Input str1:\n");
    gets(a);                     //1

    printf("Input str2:\n");
    gets(b);                     //1


    int p = -1;
    p = any(a, b);         //2

    printf("The position is %d",p);

    return 0;
} 		      	
